#pragma once

#include <sys_def.h>

void mem_copy_dst_start_end(u32_s* start_p, const u32_s* endn_p,
			    const u32_s src_b[]);

void mem_set_start_end(u32_s* start_p, const u32_s* endn_p,
		       u32_s value);

// 将应加载到内存的数据加载，只应在MAIN段调用。
static inline void mem_scatter_load(void) {
	extern u32_s data_vma, bss_vma;
	extern const u32_s data_lma;
	mem_copy_dst_start_end(&data_vma, &bss_vma, &data_lma);
	extern const u32_s bss_vma_endn;
	mem_set_start_end(&bss_vma, &bss_vma_endn, 0);
}
